home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / coding / 80x86 / code32.lzh / STRCMP.RT < prev    next >
Text File  |  1993-01-09  |  687b  |  33 lines

  1. public  _strcmp
  2. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  3. ; Compare two strings
  4. ; In:
  5. ;   ESI -> first string
  6. ;   EDI -> second string
  7. ; Out:
  8. ;   CF=1 - strings are not the same
  9. ;   CF=0 - strings are equal
  10. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  11. _strcmp:
  12.         push ax
  13.         push esi
  14.         push edi
  15. strcmpl:
  16.         lodsb
  17.         mov ah,[edi]
  18.         inc edi
  19.         cmp al,ah
  20.         jne short strcmpf0
  21.         or al,al
  22.         jnz strcmpl
  23.         clc
  24.         jmp short strcmpf1
  25. strcmpf0:
  26.         stc
  27. strcmpf1:
  28.         pop edi
  29.         pop esi
  30.         pop ax
  31.         ret
  32.  
  33.